package com.huawei.aiservice.impl.strategy;

import com.huawei.aiservice.entity.pojo.Rule;
import com.huawei.aiservice.exception.BusinessException;

public class RuleFacotry {
    public static RuleStrategy getRuleStrategy(Rule rule)
    {
        RuleStrategy ruleStrategy = null;
        switch (rule.getRuleType()) {
            case INCONSISTENT:
                ruleStrategy = new InConsistentRule();
                break;
            default:
                throw new BusinessException("Unexpected value: " + rule.getRuleType());
        }
        return ruleStrategy;
    }
}
